<extend name="base/Base" />
<block name="Style">
<!-- FooTable Plugin CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/vendor/plugins/footable/css/footable.core.min.css">
		<!-- Admin Forms CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/assets/admin-tools/admin-forms/css/admin-forms.css">
		<js href="__ADDON__/ajaxupload/js/jquery.js" />
		<js href="__ADDON__/ajaxupload/js/ajaxupload.js" />
		<script type="text/javascript">
		$(function(){
			var button = $('#upload_button'), interval;
			var confirmdiv = $('#uploadphotoconfirm');
			var fileType = "pic",fileNum = "one"; 
			new AjaxUpload(button,{
				action: "__APP__/Home/Upload/Image/Addon/AjaxUpload.html",
				name: 'userfile',
				onSubmit : function(file, ext){
					if(fileType == "pic")
					{
						if (ext && /^(jpg|png|jpeg|gif|JPG)$/.test(ext)){
							this.setData({
								'info': '文件类型为图片'
							});
						} else {
							 confirmdiv.text('文件格式错误，请上传格式为.png .jpg .jpeg 的图片');
							return false;               
						}
					}
								
					confirmdiv.text('文件上传中');
					
					if(fileNum == 'one')
						this.disable();
					
					interval = window.setInterval(function(){
						var text = confirmdiv.text();
						if (text.length < 14){
							confirmdiv.text(text + '.');                    
						} else {
							confirmdiv.text('文件上传中');             
						}
					}, 200);
				},
				onComplete: function(file, response){
					if(response != "success"){
						if(response =='2'){
							confirmdiv.text("文件格式错误，请上传格式为.png .jpg .jpeg 的图片");
						}else{
							
							confirmdiv.text("上传完成");
							
							$("#newbikephotoName").val(response);
							$("#newbikephoto").attr("src",response);	
							$("#imgurl").attr("value",response);
						}
						
					}
										  
					window.clearInterval(interval);
								
					this.enable();
					
					if(response == "success")
					alert('上传成功');              
				}
			});
		});
		</script>
</block>
<block name="Topbar">
	
 <header id="topbar" class="ph10">
        <div class="topbar-left">
          <ul class="nav nav-list nav-list-topbar pull-left">
           <!--  <li>
              <a href="__APP__/Mall/Classify/Create_album.html">新增专辑</a>
            </li> -->
            <li  class="active" >
              <a  href="__APP__/Mall/Classify/all_album.html"   >专辑列表</a>
            </li>
			<li  class="" >
              <a  href="__APP__/Mall/Classify/tui_album.html"   >推荐专辑</a>
            </li>
			<li  class="" >
              <a  href="__APP__/Mall/Classify/no_album.html"   >待审核</a>
            </li>
           
          </ul>
        </div>
        <div class="topbar-right hidden-xs hidden-sm">
		 <a href="#"  onclick="selectAll()" class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star pr5"></span>全选</a>
			 <a href="#"   onclick="unSelect()"  class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star-o pr5"></span>不选</a>
			 <a href="#"    onclick="reverse()"class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star-half-o pr5"></span>反选</a>
			  <a href="#" onclick="tuijian()" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-trash-o pr5"></span>加入推荐</a>
			  <a href="#" onclick="status(1)" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-trash-o pr5"></span>审核通过</a>
			  <a href="#" onclick="status(4)" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-trash-o pr5"></span>审核不通过</a>
			  <a href="#" onclick="status(0)" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-pause pr5"></span>删除</a>
			 
						  
          
        </div>
      </header> 
	<!--   <header id="topbar" class="ph10">
        <div class="topbar-left">
          <ul class="nav nav-list nav-list-topbar pull-left">
            <li>
              <a href="__APP__/Mall/Page/music_create.html">新增单曲</a>
            </li>
            <li  class="" >
              <a  href="__APP__/Mall/Page/album_song.html">单曲管理</a>
            </li>
           
          </ul>
        </div>
        
      </header> -->
      
</block>
<block name="Content">
	 <!-- begin: .tray-center -->
        <div class="row">

        <!-- Panel with: Data Filter -->
          <div class="col-md-12" id="spy2" >
            <div class="panel-heading">
              <span class="panel-title">
                <span class="fa fa-search"></span>分类信息</span>
               <div class="pull-right">
			 	
              </div> 
            </div>
            <div class="panel-menu">
              <input id="fooFilter" type="text" class="form-control" placeholder="请输入搜索的关键字">
            </div>
            <div class="panel-body pn">
              <table class="table footable" data-filter="#fooFilter"  data-page-navigation=".pagination" data-page-size="100">
               <thead>
											<volist name="list" id="list">
					<tr>
						
						<th style="width:4%;">批量</th>
						<th data-hide="phone">#</th>
					
						<th data-hide="phone,tablet">专辑</th>
						<th>上传时间</th>
						<th>发行时间</th>
						<th>状态</th>
						
						<th data-hide="phone,tablet">操作</th>
					</tr>
				</thead>
				<tbody>
					
					<tr>
						<td class="text-center">
						<center>
							<label class="option block mn">
							  <input type="checkbox" id="batch" name="batch" value="{$list.id}">
							
							</label>
							</center>
						  </td>
						<td>{$i}</td>
						<td>{$list.nickname}</td>
						<td>{$list.name}</td>
						<td>{$list.time|date="Y-m-d H:i",###}</td>
						<td>{$list.release_time|date="Y-m-d H:i",###}</td>
						<td>{$list.status|status_name}</td>
						<td>
						<a  href="__APP__/Mall/Classify/Edit_all_album/id/{$list.id}.html" class="btn btn-xs btn-primary">编辑</a>
						</td>
					</tr>
					</volist>

											</tbody>
											 <tfoot class="footer-menu">
												<tr>
												  <td colspan="12">
													<nav class="text-right">
													  <ul class="pagination hide-if-no-paging"></ul>
													</nav>
												  </td>
												</tr>
											  </tfoot>

										</table>
            </div>
          </div>
		      
      </div>

		   <aside class="tray tray-right tray290" data-tray-height="match">
		<form action="__SELF__" method="get">
          <!-- menu quick links -->
          <div class="admin-form">

            <h4>搜索专辑</h4>
			提示：<span style="color:red;">为空时则不作为搜索条件</span>

            <hr class="short">
			<div class="section mb15">
              <label for="order-id" class="field prepend-icon">
                <input type="text" name="uid" id="uid" class="gui-input" placeholder="请输入音乐人UID" value="{$uid}">
                <label for="order-id" class="field-icon">
                  <i class="fa fa-user"></i>
                </label>
              </label>
            </div>
			<div class="section mb15">
              <label for="order-id" class="field prepend-icon">
                <input type="text" name="name" id="name" class="gui-input" placeholder="请输入专辑名称" value="{$name}">
                <label for="order-id" class="field-icon">
                  <i class="fa fa-flag"></i>
                </label>
              </label>
            </div>
           
            <h5><small>请选择开始时间(上传时间)</small></h5>
            <div class="section row mb15">
              <div class="col-md-12">
                <label for="price1" class="field prepend-icon">
				  <input name="begin_time" placeholder="请输入日期" value='{$begin_time|date="Y-m-d",###}' class="laydate-icon gui-input" onclick="laydate()">
                  <label for="price1" class="field-icon">
                    <i class="fa fa-calendar"></i>
                  </label>
                </label>
              </div>
              
            </div>
			
			 <h5><small>请选择结束时间	</small></h5>
            <div class="section row mb15">
              <div class="col-md-12">
                <label for="price1" class="field prepend-icon">
				  <input name="end_time" placeholder="请输入日期" value='{$end_time|date="Y-m-d",###}' class="laydate-icon gui-input" onclick="laydate()">
                  <label for="price1" class="field-icon">
                    <i class="fa fa-calendar"></i>
                  </label>
                </label>
              </div>
            </div>
			
			 <h5><small>请选择状态</small></h5>
            <div class="section mb15">
              <label class="field select">
                <select id="filter-categories" name="status">
				  <option value="0" selected="selected">全部状态</option>
                  <volist name="status_list" id="status_list">
						<if condition="$status_list.id eq $status">	
						<option value ="{$status_list.id}" selected>|-- {$status_list.name}</option>
						<else />
						<option value ="{$status_list.id}" >|-- {$status_list.name}</option>
						</if>
					</volist>
                </select>
                <i class="arrow double"></i>
              </label>
            </div>
            <hr class="short">

            <div class="section">
                <button class="btn btn-default btn-sm ph25" type="submit" style="width:100%;">搜索</button>
               
            </div>

          </div>
		</form>
        </aside>
</block>
<block name="Script">
	
  <!-- FooTable Plugin -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.all.min.js"></script>
   <!-- FooTable Addon -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.filter.min.js"></script>
  
 <script type="text/javascript">
 
	
		function unSelect(){
				
		  $("input[id='batch']").each(function(){
		   $(this).prop("checked",false);
		  });  
		  
	
		}
		
		function selectAll(){
				
		 $("input[id='batch']").each(function(){
		   $(this).prop("checked",true);
		  });  
		  
		}
		
		function reverse(){
				
		 $("input[id='batch']").each(function(){
			$(this).prop("checked",!this.checked);   
		  
			})
		}
		
		
		
					function tuijian(){
							 var id=$('input[id="batch"]:checked').map(function(){return this.value}).get().join();
							
							layer.confirm('你确定要这样做么？', {
							  btn: ['确定','取消'] //按钮
							}, function(){
							  
							  $.ajax({
									type:'POST',
									url:"__APP__/Mall/Page/recommended.html",
									data:{
										
										"id": id,
										"recommended":1,
									},
									success:function(data){			
											var info = eval(data)
											if (info.errcode == 0) {
												layer.msg(info.errmsg);
												setTimeout(window.location.reload(),3000);
												
											}else{
												layer.msg(info.errmsg);
											}
									},
									error:function(){
										layer.msg('系统繁忙,请稍候重试！');
									}
								
								});	 
							  
							}, function(){
							  
							  
							});
					}
					
					function status(status){
				
				
						 var id=$('input[id="batch"]:checked').map(function(){return this.value}).get().join();
						
						layer.confirm('你确定要这样做么？', {
						  btn: ['确定','取消'] //按钮
						}, function(){
						  
						  $.ajax({
								type:'POST',
								url:"__APP__/Mall/Classify/Delete.html",
								data:{
									
									"id": id,
									"status": status,
									
								},
								success:function(data){			
										var info = eval(data)
										if (info.errcode == 0) {
										
											layer.msg(info.errmsg);
											setTimeout(window.location.reload(),3000);
											
										}else{
											layer.msg(info.errmsg);
										}
								},
								error:function(){
									layer.msg('系统繁忙,请稍候重试！');
								}
							
							});	 
						  
						}, function(){
						  
						  
						});

					
				
				}
				
		  </script>
 <script type="text/javascript">
  jQuery(document).ready(function() {

 

    // Init FooTable Examples
    $('.footable').footable();


  });
  </script>
</block>